{"ast":null,"code":"let e = e => \"object\" == typeof e && null != e && 1 === e.nodeType,\n  t = (e, t) => (!t || \"hidden\" !== e) && \"visible\" !== e && \"clip\" !== e,\n  n = (e, n) => {\n    if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {\n      let l = getComputedStyle(e, null);\n      return t(l.overflowY, n) || t(l.overflowX, n) || (e => {\n        let t = (e => {\n          if (!e.ownerDocument || !e.ownerDocument.defaultView) return null;\n          try {\n            return e.ownerDocument.defaultView.frameElement;\n          } catch (e) {\n            return null;\n          }\n        })(e);\n        return !!t && (t.clientHeight < e.scrollHeight || t.clientWidth < e.scrollWidth);\n      })(e);\n    }\n    return !1;\n  },\n  l = (e, t, n, l, i, o, r, d) => o < e && r > t || o > e && r < t ? 0 : o <= e && d <= n || r >= t && d >= n ? o - e - l : r > t && d < n || o < e && d > n ? r - t + i : 0,\n  i = e => {\n    let t = e.parentElement;\n    return null == t ? e.getRootNode().host || null : t;\n  };\nvar o = (t, o) => {\n  var r, d, h, f, u, s;\n  if (\"undefined\" == typeof document) return [];\n  let {\n      scrollMode: a,\n      block: c,\n      inline: g,\n      boundary: m,\n      skipOverflowHiddenElements: p\n    } = o,\n    w = \"function\" == typeof m ? m : e => e !== m;\n  if (!e(t)) throw new TypeError(\"Invalid target\");\n  let W = document.scrollingElement || document.documentElement,\n    H = [],\n    b = t;\n  for (; e(b) && w(b);) {\n    if (b = i(b), b === W) {\n      H.push(b);\n      break;\n    }\n    null != b && b === document.body && n(b) && !n(document.documentElement) || null != b && n(b, p) && H.push(b);\n  }\n  let v = null != (d = null == (r = window.visualViewport) ? void 0 : r.width) ? d : innerWidth,\n    y = null != (f = null == (h = window.visualViewport) ? void 0 : h.height) ? f : innerHeight,\n    E = null != (u = window.scrollX) ? u : pageXOffset,\n    M = null != (s = window.scrollY) ? s : pageYOffset,\n    {\n      height: x,\n      width: I,\n      top: C,\n      right: R,\n      bottom: T,\n      left: V\n    } = t.getBoundingClientRect(),\n    k = \"start\" === c || \"nearest\" === c ? C : \"end\" === c ? T : C + x / 2,\n    B = \"center\" === g ? V + I / 2 : \"end\" === g ? R : V,\n    D = [];\n  for (let e = 0; e < H.length; e++) {\n    let t = H[e],\n      {\n        height: n,\n        width: i,\n        top: o,\n        right: r,\n        bottom: d,\n        left: h\n      } = t.getBoundingClientRect();\n    if (\"if-needed\" === a && C >= 0 && V >= 0 && T <= y && R <= v && C >= o && T <= d && V >= h && R <= r) return D;\n    let f = getComputedStyle(t),\n      u = parseInt(f.borderLeftWidth, 10),\n      s = parseInt(f.borderTopWidth, 10),\n      m = parseInt(f.borderRightWidth, 10),\n      p = parseInt(f.borderBottomWidth, 10),\n      w = 0,\n      b = 0,\n      O = \"offsetWidth\" in t ? t.offsetWidth - t.clientWidth - u - m : 0,\n      X = \"offsetHeight\" in t ? t.offsetHeight - t.clientHeight - s - p : 0,\n      Y = \"offsetWidth\" in t ? 0 === t.offsetWidth ? 0 : i / t.offsetWidth : 0,\n      L = \"offsetHeight\" in t ? 0 === t.offsetHeight ? 0 : n / t.offsetHeight : 0;\n    if (W === t) w = \"start\" === c ? k : \"end\" === c ? k - y : \"nearest\" === c ? l(M, M + y, y, s, p, M + k, M + k + x, x) : k - y / 2, b = \"start\" === g ? B : \"center\" === g ? B - v / 2 : \"end\" === g ? B - v : l(E, E + v, v, u, m, E + B, E + B + I, I), w = Math.max(0, w + M), b = Math.max(0, b + E);else {\n      w = \"start\" === c ? k - o - s : \"end\" === c ? k - d + p + X : \"nearest\" === c ? l(o, d, n, s, p + X, k, k + x, x) : k - (o + n / 2) + X / 2, b = \"start\" === g ? B - h - u : \"center\" === g ? B - (h + i / 2) + O / 2 : \"end\" === g ? B - r + m + O : l(h, r, i, u, m + O, B, B + I, I);\n      let {\n        scrollLeft: e,\n        scrollTop: f\n      } = t;\n      w = Math.max(0, Math.min(f + w / L, t.scrollHeight - n / L + X)), b = Math.max(0, Math.min(e + b / Y, t.scrollWidth - i / Y + O)), k += f - w, B += e - b;\n    }\n    D.push({\n      el: t,\n      top: w,\n      left: b\n    });\n  }\n  return D;\n};\nexport { o as default };","map":{"version":3,"mappings":"","names":[],"sources":[],"sourcesContent":["let e=e=>\"object\"==typeof e&&null!=e&&1===e.nodeType,t=(e,t)=>(!t||\"hidden\"!==e)&&(\"visible\"!==e&&\"clip\"!==e),n=(e,n)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let l=getComputedStyle(e,null);return t(l.overflowY,n)||t(l.overflowX,n)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},l=(e,t,n,l,i,o,r,d)=>o<e&&r>t||o>e&&r<t?0:o<=e&&d<=n||r>=t&&d>=n?o-e-l:r>t&&d<n||o<e&&d>n?r-t+i:0,i=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t};var o=(t,o)=>{var r,d,h,f,u,s;if(\"undefined\"==typeof document)return[];let{scrollMode:a,block:c,inline:g,boundary:m,skipOverflowHiddenElements:p}=o,w=\"function\"==typeof m?m:e=>e!==m;if(!e(t))throw new TypeError(\"Invalid target\");let W=document.scrollingElement||document.documentElement,H=[],b=t;for(;e(b)&&w(b);){if(b=i(b),b===W){H.push(b);break}null!=b&&b===document.body&&n(b)&&!n(document.documentElement)||null!=b&&n(b,p)&&H.push(b)}let v=null!=(d=null==(r=window.visualViewport)?void 0:r.width)?d:innerWidth,y=null!=(f=null==(h=window.visualViewport)?void 0:h.height)?f:innerHeight,E=null!=(u=window.scrollX)?u:pageXOffset,M=null!=(s=window.scrollY)?s:pageYOffset,{height:x,width:I,top:C,right:R,bottom:T,left:V}=t.getBoundingClientRect(),k=\"start\"===c||\"nearest\"===c?C:\"end\"===c?T:C+x/2,B=\"center\"===g?V+I/2:\"end\"===g?R:V,D=[];for(let e=0;e<H.length;e++){let t=H[e],{height:n,width:i,top:o,right:r,bottom:d,left:h}=t.getBoundingClientRect();if(\"if-needed\"===a&&C>=0&&V>=0&&T<=y&&R<=v&&C>=o&&T<=d&&V>=h&&R<=r)return D;let f=getComputedStyle(t),u=parseInt(f.borderLeftWidth,10),s=parseInt(f.borderTopWidth,10),m=parseInt(f.borderRightWidth,10),p=parseInt(f.borderBottomWidth,10),w=0,b=0,O=\"offsetWidth\"in t?t.offsetWidth-t.clientWidth-u-m:0,X=\"offsetHeight\"in t?t.offsetHeight-t.clientHeight-s-p:0,Y=\"offsetWidth\"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,L=\"offsetHeight\"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(W===t)w=\"start\"===c?k:\"end\"===c?k-y:\"nearest\"===c?l(M,M+y,y,s,p,M+k,M+k+x,x):k-y/2,b=\"start\"===g?B:\"center\"===g?B-v/2:\"end\"===g?B-v:l(E,E+v,v,u,m,E+B,E+B+I,I),w=Math.max(0,w+M),b=Math.max(0,b+E);else{w=\"start\"===c?k-o-s:\"end\"===c?k-d+p+X:\"nearest\"===c?l(o,d,n,s,p+X,k,k+x,x):k-(o+n/2)+X/2,b=\"start\"===g?B-h-u:\"center\"===g?B-(h+i/2)+O/2:\"end\"===g?B-r+m+O:l(h,r,i,u,m+O,B,B+I,I);let{scrollLeft:e,scrollTop:f}=t;w=Math.max(0,Math.min(f+w/L,t.scrollHeight-n/L+X)),b=Math.max(0,Math.min(e+b/Y,t.scrollWidth-i/Y+O)),k+=f-w,B+=e-b}D.push({el:t,top:w,left:b})}return D};export{o as default};"]},"metadata":{},"sourceType":"module"}